#jdk17支持
FROM jdk:17

# 设置工作目录, docker exec -it image bash 进入的就是这个目录
WORKDIR /opt/dexian/admin

# 复制解压后的文件到工作目录中
COPY ./db db/
COPY ./lib lib/
COPY ./messages messages/
COPY ./static static/
COPY ./templates templates/
COPY ./application-authorize.yml application-authorize.yml
COPY ./application-core.yml application-core.yml
COPY ./application-redis-cache.yml application-redis-cache.yml
COPY ./application.yml application.yml
COPY ./logback-spring.xml logback-spring.xml
COPY ./dexian-admin.jar dexian-admin.jar

# 使用上海时区
ENV TIME_ZONE="Asia/Shanghai"
RUN ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime

# 暴露端口，该端口要和springboot项目的端口一样
EXPOSE 9090
# 启动应用固定命令
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Duser.timezone=GMT+08", "-jar"]
# 动态参数
CMD ["dexian-admin.jar"]

